package com.knoya.chejian.pda.module.ruku

class RukuCangBeanList(var cangkus : ArrayList<String>,var cangweis : ArrayList<String>) {
    var cangs = ArrayList<RukuCangBean>()
    fun add(warehouse : String , cangwei : String){
        for (bean in cangs){
            if(warehouse == bean.warehouse){
                bean.positions.add(cangwei)
                return
            }
        }
        var cangbean = RukuCangBean()
        cangbean.warehouse = warehouse
        cangbean.positions.add(cangwei)
        cangs.add(cangbean)
    }

    fun cangkudown(warehouse : String){
        cangweis.clear()
        for (bean in cangs){
            if(warehouse == bean.warehouse){
                for (s in bean.positions){
                    cangweis.add(s)
                }
            }

        }
    }

    fun cangkuclean(){
        cangkus.clear()
        cangweis.clear()
        for (bean in cangs){
            cangkus.add(bean.warehouse)
        }
    }

    override fun toString(): String {
        return "RukuCangBeanList(cangkus=$cangkus, cangweis=$cangweis, cangs=$cangs)"
    }

    class RukuCangBean {
        var warehouse = ""
        var positions = ArrayList<String>()
        override fun toString(): String {
            return "RukuCangBean(warehouse='$warehouse', positions=$positions)"
        }

    }
}